package com.wisezone.HomeWork.home04;

public class ThreadWindow implements Runnable{
    int tickets = 100;
    int i=1;

    @Override
    public void run() {
        while (true){
            if (tickets>0){
                System.out.println(i+":"+Thread.currentThread().getName()+"正在售票...票号为："+tickets--);
            }
            else{
                break;
            }
            i++;
        }
    }
}
